package ssm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import ssm.dao.MyResult;
import ssm.service.WaysService;

import java.util.Map;
@Controller
@RequestMapping("/way")
public class WaysController {

    @Autowired
    private WaysService waysService;

    @RequestMapping("/getTrackAndWay")
    @ResponseBody
    public MyResult getWay_Card(@RequestParam String jid,
                                @RequestParam String starttime,
                                @RequestParam String endtime){
        Map<String,Object>map=waysService.getWay_person(jid,starttime,endtime);
        return MyResult.ok(map);
    }





    @RequestMapping("/getWay_car")
    @ResponseBody
    public MyResult getWay_car(@RequestParam String cph,
                               @RequestParam String starttime,
                               @RequestParam String endtime){
        Map<String,Object>map=waysService.getWay_car(cph,starttime,endtime);
        return  MyResult.ok(map);
    }


}
